﻿using System.Data.Entity.ModelConfiguration;
namespace wh40klbModel.ModelConfiguration
{
    class SquadTypeConfiguration : EntityTypeConfiguration<SquadType>
    {
        public SquadTypeConfiguration()
        {
            //Cle Primaire et table
            HasKey(st => st.Id);
            //Propriete
            Property(st => st.Name).IsRequired().HasMaxLength(25);
            //cle etrangere
            HasMany(st => st.Squads).WithRequired(s => s.SquadType);
            HasMany(st => st.ArmySquadTypeUseds).WithRequired(astu => astu.SquadType);
        }
    }
}
